/*
package com.survey.Controller;

import io.goeasy.GoEasy;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class PhoneLogin {
    */
/**
     * 初始界面
     *
     * @return
     *//*

    @RequestMapping(value = "/index1")
    public String index() {
        return "/QRindex.jsp";
    }

    */
/**
     * 网页的登陆成功后进入网页版的页面
     *//*

    @RequestMapping(value = "/hello")
    public String hello(HttpServletRequest request, HttpServletResponse response) {
        // System.out.println("hello");
        // 将uuid对应的user的信息放在session中以便网页上使用
        String uuid = request.getParameter("uuid");
      */
/*  User user = LoginUserVo.getLoginUserMap().get(uuid);
        HttpSession session = request.getSession();
        session.removeAttribute("user");
        session.setAttribute("user", user);*//*

        return "/QRHello.jsp";
    }

    */
/**
     * 移动端扫码成功后跳转的页面
     *
     * @return
     *//*

    @RequestMapping(value = "/home")
    public String home() {
        return "/QRhome.jsp";
    }

    */
/**
     * 移动端点击登录后开始的操作 进行验证信息 返回结果
     *
     * @param request
     * @param response
     * @throws IOException
     *//*


    @RequestMapping(value = "/phoneLogin")
    public void phoneLogin(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String uuid = request.getParameter("uuid");
        System.out.println(username + "" + password + uuid);
        // TODO 验证登录
        boolean bool = true;
        // 是否登陆
        boolean islogin = false;
        if (bool) {
            // 如果没有uuid对应的user表示第一次登陆没有进行扫码 将登陆信息存入map
            //User user = LoginUserVo.getLoginUserMap().get(uuid);
            if (1==1) {
                */
/*user = new User(username, password);
                LoginUserVo.getLoginUserMap().put(uuid, user);*//*

                bool = false;
                islogin = true;
                GoEasy goEasy = new GoEasy("rest-hangzhou.goeasy.io ","BC-afd2c07a090549ed9661734a06ec3a26 ");
                goEasy.publish(uuid, "登陆成功"); // 直接推送前端 用uuid作为channel保证是对应的用户
                System.out.println("xxxxxxdx");
            } else {
                // 如果有uuid对应的user表示二维码已经过期 但是事实上在手机移动端应该进行验证的

                islogin = false;
                System.out.println("二维码已过期，请刷新页面");
            }
        }
        PrintWriter out = response.getWriter();
        out.print(islogin);// 传递登陆是否成功
        out.flush();
        out.close();
    }

    */
/**
     * 将用户信息传到用户移动端的确认登录界面
     *
     * @param request
     * @param uuid
     * @return
     *//*

    @RequestMapping(value = "/loginPage")
    public ModelAndView loginPage(HttpServletRequest request, String uuid) {
        System.out.println("进入loginPage");
        request.setAttribute("uuid", uuid);
        // 在此得到Phone传过来的user信息 但是在这里没有写移动端代码就在页面login.jsp上直接写了虚拟数据

        ModelAndView mv = new ModelAndView("/userLogin.jsp");
        return mv;
    }
}
*/
